package com.example.mountainwalker.mapper;

import com.example.mountainwalker.entity.GroupTourRegistrationInfo;
import com.example.mountainwalker.entity.StrategyCommentInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface StrategyCommentMapper {
    @Select("SELECT * FROM mw.strategycomment")
    List<StrategyCommentInfo> getStrategyCommentInfo();

    @Select("select * from mw.strategycomment where StrategyCommentID= #{StrategyCommentID}")
    StrategyCommentInfo getStrategyCommentInfoById(Integer StrategyCommentID);

    @Delete("delete from mw.strategycomment where StrategyCommentID= #{StrategyCommentID}")
    int deleteStrategyCommentInfoById(Integer StrategyCommentID);

    @Insert("insert into mw.strategycomment (UserID,ScenicSpotID,CommentContent,CommentTime) " +
            "values(#{UserID}, #{ScenicSpotID}, #{CommentContent}, #{CommentTime})")
    int insertStrategyCommentInfo(StrategyCommentInfo strategyCommentInfo);

    @Update("update mw.strategycomment set " +
            "UserID=#{UserID}, " +
            "ScenicSpotID=#{ScenicSpotID}, " +
            "CommentContent=#{CommentContent}, " +
            "CommentTime=#{CommentTime} "+
            "WHERE StrategyCommentID=#{StrategyCommentID}")
    int updateStrategyCommentInfo(StrategyCommentInfo strategyCommentInfo);
}
